﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategoryJob.ascx.cs" Inherits="Administrator_AdminControl_CategoryJob" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%--<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>--%>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function gridCategoryJob_Command(sender, args) {
            var result = true;
            if (args.get_commandName() == "Delete") {
                result = confirm('Bạn có chắc muốn xóa dữ liệu không?');
                if (result == false) {
                    args.set_cancel(true);
                }
            }

            return result;
        }
        
    </script>
</telerik:RadScriptBlock>

<div class="dasboard" style="width:80%;float:left">
    <div class="staticTitle">Danh mục nghề nghiệp</div>
    <div class="style-padding1">
        <table style="width:70%">
            <tr>
                <td>Mã</td>
                <td><asp:TextBox ID="txtCategoryJobCode" runat="server" 
                        ValidationGroup="validator"/></td>
            </tr>
            <tr>
                <td>Tên</td>
                <td><asp:TextBox ID="txtCategoryJobName" runat="server" Width="100%" />                    
                </td>
                <td style="padding:20px">
                    <asp:Button ID="btnSave" runat="server" Text="Lưu"
                       onclick="btnSave_Click"/></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:TextBox ID="txtSearchCategoryJobName" runat="server" Width="100%" /></td>
                <td style="padding:20px"><asp:Button ID="btnSearch" runat="server" Text="Tìm kiếm" 
                        onclick="btnSearch_Click"/></td>
            </tr>
        </table>
                
        <telerik:RadGrid runat="server" ID="gridCategoryJob" GridLines="None" 
            AllowPaging="True" AllowSorting="True" 
            PageSize="10" AutoGenerateColumns="false"
            OnDeleteCommand="gridCategoryJob_DeleteCommand"
            onneeddatasource="gridCategoryJob_NeedDataSource"
            onupdatecommand="gridCategoryJob_UpdateCommand">
            <MasterTableView DataKeyNames="GeneralCategory_Id" 
                 nomasterrecordstext="Không có dữ liệu để hiển thị">                    
                <Columns>                   
                    <telerik:GridBoundColumn DataField="GeneralCategory_Code" HeaderText="Mã nghành nghề">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="GeneralCategory_Name" HeaderText="Tên nghành nghề">                    
                    </telerik:GridBoundColumn>                
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="MyImageButton" />
                    </telerik:GridEditCommandColumn>                    
                    <telerik:GridButtonColumn ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
                </Columns>
            
             <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Cập nhật"
                        UniqueName="EditCommandColumn1" CancelText="Hủy cập nhật">
                    </EditColumn>                  
             </EditFormSettings>
            </MasterTableView>

        <FilterMenu EnableImageSprites="False"></FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
        <ClientSettings>
               <ClientEvents OnCommand="gridCategoryJob_Command" />               
        </ClientSettings>
        </telerik:RadGrid>

        <telerik:RadAjaxManager ID="ajaxmanagerCategoryJob" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridCategoryJob">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridCategoryJob" EventName="gridCategoryJob_DeleteCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridCategoryJob" EventName="gridCategoryJob_CancelCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridCategoryJob" EventName="gridCategoryJob_UpdateCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridCategoryJob" LoadingPanelID="loadingpanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lblScript" LoadingPanelID="loadingpanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="loadingpanel1" Skin="Office2007">
    </telerik:RadAjaxLoadingPanel>    
</div>
</div>